<template>
  <div class="box" v-loading.fullscreen="fullscreenLoading">
    <div class="title">监理验收意见表</div>
    <div style="text-align: center;margin-top:20px;" v-if="dataInfo!=null || dataInfo!=''">
      <iframe
        frameborder="0"
        name="showHere"
        style="width:70%;height:1000px;"
        scrolling="auto"
        :src="$https+dataInfo.filePath"
      ></iframe>
    </div>
    <div v-else class="noData">暂无数据</div>
  </div>
</template>

<script>
import { saveSupervising, queryOpinitonTable } from "@/api/jianguanYanshou";

export default {
  data() {
    return {
	  dataInfo: "",
	  fullscreenLoading:false
    };
  },
  created() {
    this.getData();
  },
  methods: {
    getData() {
      let obj = {
        projectId: localStorage.getItem("projectId")
	  };
	  this.fullscreenLoading = true;
      saveSupervising(obj).then(res => {
		  this.fullscreenLoading = false;
        if (res.code == 1000) {
          this.$nextTick(() => {
			  this.fullscreenLoading = true;
            queryOpinitonTable(obj).then(res => {
				this.fullscreenLoading = false;
              if (res.code == 1000) {
                if (res.data != null) {
                  this.dataInfo = res.data;
                }
              }
            }).catch(error => {
                  this.fullscreenLoading = false;
                });
          });
        }
      }).catch(error => {
                  this.fullscreenLoading = false;
                });
    }
  }
};
</script>

<style lang="scss" scoped>
* {
  box-sizing: border-box;
}
.box {
  padding: 30px;
}
.display_flex {
  display: flex;
  align-items: center;
}
.title {
  font-size: 20px;
  font-weight: bold;
  color: #444;
  text-align: center;
  margin-bottom: 10px;
}
.btn {
  text-align: right;
}
.noData {
  text-align: center;
  font-weight: bold;
  font-size: 18px;
  color: #606266;
  padding: 20px;
}
</style>